PSP_FW_VERSION=371
TARGET = PSPTris
RELEASE_DIR           = release
PSPTRIS_RELEASE_DIR  = $(RELEASE_DIR)/PSPTris
PSP_EBOOT_ICON = eboot_resource/icon0.png
PSP_EBOOT_PIC1 = eboot_resource/pic1.png

OBJS = PSPTris_main.o PSPTris_intro.o PSPTris_audio.o PSPTris_menu.o PSPTris_game.o PSPTris_game_classic.o PSPTris_game_original.o PSPTris_game_color.o PSPTris_credits.o PSPTris_highscore.o jsaParticle.o jsaTextureCache.o jsaRand.o PSPKeyHandler.o

INCDIR = ../ ../../SharedLib/danzeff
CFLAGS = -G0 -Wall -g -O0 -fno-strict-aliasing
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LIBDIR = ../../SharedLib/lib/
LDFLAGS =
DANZEFF_LIBS = -ldanzeffgu -lpng -lz -lm  -lpspgu -lpspaudio -ljpeg -lpsphprm
LIBS = $(DANZEFF_LIBS) -lsupc++ -lstdc++ -lpspgum -lpspgu -lpsprtc -lpsppower -lpng -lz -lm -lmikmod -lpspvalloc -lpspaudio

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = PSPTris

all: $(EXTRA_TARGETS) $(FINAL_TARGET)
	mkdir -p $(PSPTRIS_RELEASE_DIR)
	cp -vf EBOOT.PBP $(PSPTRIS_RELEASE_DIR)
	mkdir -p $(PSPTRIS_RELEASE_DIR)/Music
	cp -vf audio/*.mod $(PSPTRIS_RELEASE_DIR)/Music
	cp -vf audio/*.xm $(PSPTRIS_RELEASE_DIR)/Music
	cp $(PSPTRIS_RELEASE_DIR)/Music/menu.mod $(PSPTRIS_RELEASE_DIR)/Music/ingame_default.mod
	mkdir -p $(PSPTRIS_RELEASE_DIR)/Samples
	cp -vf audio/*.wav $(PSPTRIS_RELEASE_DIR)/Samples
	mkdir -p $(PSPTRIS_RELEASE_DIR)/Textures
	cp -vf graphics/*.png $(PSPTRIS_RELEASE_DIR)/Textures
	cp -vf readme.txt $(PSPTRIS_RELEASE_DIR)/.
	cp -vf whatsnew.txt $(PSPTRIS_RELEASE_DIR)/.
# copy files used for Danzeff OSK
	mkdir -p $(PSPTRIS_RELEASE_DIR)/graphics
	cp -vf ../../SharedLib/danzeff/graphics/*.png $(PSPTRIS_RELEASE_DIR)/graphics
	rm -rf $(PSPTRIS_RELEASE_DIR)/graphics/keys_c_t.png
	rm -rf $(PSPTRIS_RELEASE_DIR)/graphics/keys_t.png
	rm -rf $(PSPTRIS_RELEASE_DIR)/graphics/nums_c_t.png
	rm -rf $(PSPTRIS_RELEASE_DIR)/graphics/nums_t.png

#clean:
#	rm -fv *.o *.PBP *.SFO $(OBJS)
#	rm -Rf $(RELEASE_DIR)

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
